package com.aliyun.frontframework;

import android.graphics.Bitmap;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * 视频结构
 * 
 * @author allan
 * 
 */

public class DVRVideoModel implements Parcelable {
	/**
	 * int cameraId, String name, String path, long size, int length, String
	 * locationinfo public byte isLocked; public float latitude; public float
	 * longitude;
	 */
	public DVRVideoModel() {
	}

	public DVRVideoModel(int cameraId, String name, String path, long size,
			int duration, String locationinfo, float latitude, float longitude,
			byte islocked) {
		this.cameraId = cameraId;
		this.name = name;
		this.latitude = latitude;
		this.longitude = longitude;
		this.path = path;
		this.size = size;
		this.isLocked = islocked;
		this.duration = duration;
		this.locationInfo = locationinfo;
	}

	public byte isLocked;

	public float latitude;
	public float longitude;

	public int cameraId;

	public String name;
	/**
	 * 存储路径
	 */
	public String path;
	/**
	 * 视频大小
	 */
	public long size;

	/**
	 * 视频长度 间隔
	 */
	public int duration;

	/**
	 * 拍摄地址
	 */
	public String locationInfo;

	public Bitmap getPreview() {
		return null;
	}

	@Override
	public String toString() {

		return "cameraId=" + cameraId + " ,name=" + name + " ,path=" + path
				+ " ,size=" + size + " ,duration=" + duration + " ,location="
				+ latitude + " " + longitude + " " + locationInfo
				+ " ,islocked=" + isLocked;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(cameraId);
		dest.writeString(name);
		dest.writeString(path);
		dest.writeLong(size);
		dest.writeInt(duration);
		dest.writeString(locationInfo);
		dest.writeFloat(latitude);
		dest.writeFloat(longitude);
		dest.writeByte(isLocked);
	}

	public static final Parcelable.Creator<DVRVideoModel> CREATOR = new Parcelable.Creator<DVRVideoModel>() {
		@Override
		public DVRVideoModel createFromParcel(Parcel in) {
			return new DVRVideoModel(in);
		}

		@Override
		public DVRVideoModel[] newArray(int size) {
			return new DVRVideoModel[size];
		}
	};

	private DVRVideoModel(Parcel in) {
		cameraId = in.readInt();
		name = in.readString();
		path = in.readString();
		size = in.readLong();
		duration = in.readInt();
		locationInfo = in.readString();
		latitude = in.readFloat();
		longitude = in.readFloat();
		isLocked = in.readByte();
	}
}
